﻿function nuevaFila() {
    if ($('#tablaClub tbody > tr').length == 1) {
        var fila = '<tr>' +
                '<td><textarea class="form-control reset" name="nombre"></textarea></td>' +
                '<td>' +
                '    <textarea class="form-control reset" name="direccion"></textarea>' +
                '</td>' +
            '</tr>';
        $('#tablaClub tbody > tr').after(fila);
        return false;
    } else {
        var clon = $('#tablaClub tbody>tr:last').clone(false);
        clon.insertAfter('#tablaClub tbody>tr:last');
        for (var i = 0; i < clon.find(".reset").length ; i++) {
            if (clon.find(".reset").length == 1)
                clon.find(".reset").val('');
        }
        clon.find(".reset").removeAttr("id");
        clon.find(".glyphicon").show();
        return false;
    }
}
function borrarFila(boton) {
    var par = $(boton).parent().parent(); //tr
    par.remove();
}

function RegistrarClub(form) {
    form.method = "post";
    form.submit();
}
function EditarClub(form) {
    form.action = "/cliente/AddClub";
    form.method = "get";
    form.submit();
}
function AbrirCliente(form) {
    form.action = "/cliente/Details";
    form.method = "get";
    form.submit();
}
